import request from '@/utils/request'

// 查询路线列表
export function listRoute(query) {
  return request({
    url: '/lxy/route/list',
    method: 'get',
    params: query
  })
}
// 查询旅行社之前的路线列表
export function listRouteBeforeByAgency(query) {
  return request({
    url: '/lxy/route/listBefore',
    method: 'get',
    params: query
  })
}
// 查询路线列表-满意度评分
export function listRouteGrade(query) {
  return request({
    url: '/lxy/route/listgrade',
    method: 'get',
    params: query
  })
}
// 查询路线详细
export function getRoute(id) {
  return request({
    url: '/lxy/route/' + id,
    method: 'get'
  })
}

// 新增路线
export function addRoute(data) {
  return request({
    url: '/lxy/route',
    method: 'post',
    data: data
  })
}
// 新增往年路线
export function addBeforeRoute(routeIds) {
  return request({
    url: '/lxy/route/'+routeIds,
    method: 'post',
  })
}

// 修改路线
export function updateRoute(data) {
  return request({
    url: '/lxy/route',
    method: 'put',
    data: data
  })
}

// 删除路线
export function delRoute(id) {
  return request({
    url: '/lxy/route/' + id,
    method: 'delete'
  })
}
// 提交路线
export function subRoute(id) {
  return request({
    url: '/lxy/route/' + id,
    method: 'put'
  })
}

//在已有问卷中添加路线
export function addQuestionnaireRoute(ids, questionnaireId) {
  const data = {
    questionnaireId
  }
  return request({
    url: '/lxy/route/addQuestionnaireRoute/' + ids,
    method: 'put',
    params: data
  })
}
//路线满意度调查结果-意见建议
export function satisfactionResult(id) {
  return request({
    url: '/lxy/route/satisfaction/' + id,
    method: 'get'
  })
}
